package cn.t.keycloak.demo.jpa;

import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;
import java.util.UUID;

@Entity
@Getter
@Setter
@Table(name = "VERIFY_PHONE_LOG")
public class VerifyPhoneEntity {

    public VerifyPhoneEntity() {
        this.id = UUID.randomUUID().toString().replace("-", "");
    }

    @Id
    @Column(name = "ID")
    private String id;

    @Column(name = "REALM_ID", nullable = false)
    private String realmId;

    @Column(name = "PHONE_NUMBER", nullable = false)
    private String phoneNumber;

    @Column(name = "USER_ID", nullable = false)
    private String userId;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "CREATED_AT", nullable = false)
    private Date createdAt;

    @Column(name = "CONFIRMED", nullable = false)
    private int confirmed;

    @Column(name = "REGION_CODE")
    private String regionCode;
}
